package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.WorkCompanyInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.lst.tools.mybatis.entity.DeleteBaseModel;

/**
 * 工作单位信息
 *
 * @author Frank
 * @date 2019-12-30 10:31:38
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_work_company_info")
@ApiModel(value = "工作单位信息")
public class WorkCompanyInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String COMPANY_NAME = "company_name";
    public static final String DEPARTMENT = "department";
    public static final String POST = "post";
    public static final String ADDRESS_PROVINCE_CODE = "address_province_code";
    public static final String ADDRESS_CITY_CODE = "address_city_code";
    public static final String ADDRESS_AREA_CODE = "address_area_code";
    public static final String ADDRESS_DETAILS = "address_details";
    public static final String COMPANY_PHONE = "company_phone";
    public static final String INDUSTRY_TYPE_ID = "industry_type_id";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "companyName", value = "单位名称", dataType = "String")
    @TableField(value = COMPANY_NAME)
    private String companyName;

    @ApiModelProperty(name = "department", value = "任职部门", dataType = "String")
    @TableField(value = DEPARTMENT)
    private String department;

    @ApiModelProperty(name = "post", value = "职务", dataType = "String")
    @TableField(value = POST)
    private String post;

    @ApiModelProperty(name = "addressProvinceCode", value = "单位地址，省编号", dataType = "String")
    @TableField(value = ADDRESS_PROVINCE_CODE)
    private String addressProvinceCode;

    @ApiModelProperty(name = "addressCityCode", value = "单位地址，市编号", dataType = "String")
    @TableField(value = ADDRESS_CITY_CODE)
    private String addressCityCode;

    @ApiModelProperty(name = "addressAreaCode", value = "单位地址，区编号", dataType = "String")
    @TableField(value = ADDRESS_AREA_CODE)
    private String addressAreaCode;

    @ApiModelProperty(name = "addressDetails", value = "单位地址，详细地址", dataType = "String")
    @TableField(value = ADDRESS_DETAILS)
    private String addressDetails;

    @ApiModelProperty(name = "companyPhone", value = "单位电话", dataType = "String")
    @TableField(value = COMPANY_PHONE)
    private String companyPhone;

    @ApiModelProperty(name = "industryTypeId", value = "单位类型", dataType = "Long")
    @TableField(value = INDUSTRY_TYPE_ID)
    private Long industryTypeId;


    public WorkCompanyInfo(long userId, String applyNo, WorkCompanyInfoVo workCompanyInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.companyName = workCompanyInfoVo.getCompanyName();
        this.department = workCompanyInfoVo.getDepartment();
        this.post = workCompanyInfoVo.getPost();
        this.addressProvinceCode = workCompanyInfoVo.getAddressProvinceCode();
        this.addressCityCode = workCompanyInfoVo.getAddressCityCode();
        this.addressAreaCode = workCompanyInfoVo.getAddressAreaCode();
        this.addressDetails = workCompanyInfoVo.getAddressDetails();
        this.companyPhone = workCompanyInfoVo.getCompanyPhone();
        this.industryTypeId = workCompanyInfoVo.getIndustryTypeId();
    }
}